#include<iostream.h>
#include<fstream.h>

int main()
{	
	fstream file2,file3;
	char fname [9];
	int rows,cols;
	int i,j;
	float avg=0;
	int a,d,b,u;
	float h;
	int fact,cc;
	char fwrite[50];
	float **array;
	fstream file("d:\\users\\Animesh\\satya\\CJN1.VEL",ios::in);
	if(!file)
	{
		cout << "error reading file 1\n";
		return (1);
	}
	rows=12000;
	cols=6;
	array = new float*[rows];
	for(i=0; i<rows; i++)
	array[i] = new float [cols];
			for(i=0; i<rows; i++)
			{
				for(j=0; j<cols; j++)
					file >> array[i][j];
			}
		
			for(b=0;b<cols;b++)
			{

				avg=0;
				for(j=0;j<rows;j++)
				{
				avg+=array[j][b];
				}
				avg/=rows;
				cout << avg << "\n";
//				avg/=fact;
//				file3 << avg << '\t';
			}
//				file3 << '\n';
			// free the memory and exit
			for(i=0; i<rows; i++)
				delete(array[i]);
			delete(array);
			file.close();
	return 0;
}